package com.yuzhitong.shapi.widget;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;

import com.yuzhitong.shapi.R;

/**
 * Created by Brsya
 * CreateDate: 2022/5/24  17:06
 * Description:
 * 提示loading弹框
 */
public class LoadingHintDialog  extends CenterDialog{

    private Context context;
    private View rootView;
    private LoopBackgroundView lbvLoad;
    private TextView tvHintDialogTitle;


    public LoadingHintDialog(Context context) {
        super(context);
        this.context = context;

        setContentView(rootView = LayoutInflater.from(context).inflate(R.layout.dialog_hint_load, null, false));

        initView();
        setKeyListener(false);
    }

    private void initView() {

        lbvLoad = (LoopBackgroundView) rootView.findViewById(R.id.lbv_load);
        tvHintDialogTitle = (TextView) rootView.findViewById(R.id.tv_hint_dialog_title);
    }


    public void setText(String text){
        tvHintDialogTitle.setText(text);
    }

    public void show() {
        super.show();
        lbvLoad.startLoop();
    }

    public void dismiss() {
        lbvLoad.stopLoop();
        super.dismiss();
    }
}
